#include <iostream>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string>
#include <unistd.h>
using std::string;

int main()
{
    const string path_name = "./pipe_file";
    int fd = open(path_name.c_str() , O_WRONLY);

    string message;
    // 填充数据
    // ...... 

    // 发送数据
    write(fd , message.c_str()  , message.size());

    return 0;
}